<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head  th:include="/common/base :: base"></head>
	<span>
		<link rel="stylesheet"  th:href="@{/css/pccs/info_list.css}"/>
		<script type="text/javascript" th:src="@{/js/pcjs/pageNavigation.js}"></script>
	</span>

<script th:inline="javascript">
    //定义全局变量
    var counts = /*[[${counts}]]*/ "counts";
    var url =/*[[@{/admin/info/infoListUI}]]*/ "url" ;//文件以静态的方式打开则 值为第二个值
    var pCur = /*[[${pCur}]]*/ "pCur";
    var pSize = /*[[${pSize}]]*/ "pSize";

    console.log("pCur"+pCur);
    console.log("pSize"+pSize);

    //用户搜索
    function Search(){
        document.forms[0].action=url;
		console.log(url);
        document.forms[0].submit();
    }
</script>
	<body>
		<nav class="navbar navbar-default" role="navigation">
			<div class="container-fluid">
				<div class="navbar-header">
					<a class="navbar-brand" href="#">搜索栏</a>
				</div>
				<form class="navbar-form navbar-left" role="search">
					<div class="form-group">
						<button type="button" class="btn btn-default">关键字:</button>
						<input type="text" name ="keyword" th:value="${keyword}" class="form-control" placeholder="Search">
					</div>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<div class="form-group">
						<button type="button" class="btn btn-default">类型:</button>
						<select class="form-control" name="typeId">
							<option value="0">——选信息类型——</option>
							<option th:each="type : ${typeList}"
							th:value="${type.typeId}"
							th:text="${type.typeName}"
							th:if="${typeId eq type.typeId }"
							th:attr="selected=true"
							></option>
							<option th:each="type : ${typeList}"
									th:value="${type.typeId}"
									th:text="${type.typeName}"
									th:if="${typeId ne type.typeId }"
							></option>
						</select>
					</div>
					<input type="hidden" name="pCur" value="1" id="pCurId">
					&nbsp;&nbsp;
					<button type="button"  onclick="Search()" class="btn btn-primary">搜索</button>
				</form>
			</div>
		</nav>
		<div class="panel panel-default" style="margin-top: -10px;">
			<div class="panel-heading">
				<h3 class="panel-title">
		            	用户列表
		        </h3>
			</div>
			<div class="panel-body">
				<div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" style="margin: 0 auto;width: 750px;">
					<div class="layui-table-box">
						<div class="layui-table-header">
							<table cellspacing="0" cellpadding="0" border="0" class="layui-table">
								<thead>
									<tr>
										<th data-field="ID">
											<div class="layui-table-cell laytable-cell-1-ID">
												<span>ID</span>
											</div>
										</th>
										<th data-field="content">
											<div class="layui-table-cell laytable-cell-1-content">
												<span>内容</span>
											</div>
										</th>
										<th data-field="handle">
											<div class="layui-table-cell laytable-cell-1-handle"><span>操作</span></div>
										</th>
									</tr>
								</thead>
							</table>
						</div>
						<div class="layui-table-body layui-table-main">
							<table cellspacing="0" cellpadding="0" border="0" class="layui-table">
								<tbody>
									<tr th:each="info : ${infoList}">
										<td data-field="ID">
											<div class="layui-table-cell laytable-cell-1-ID"
											th:text="${info.infoId}"></div>
										</td>
										<td data-field="content">
											<div class="layui-table-cell laytable-cell-1-Content"
											th:text="${info.infoContent}"
											></div>
										</td>
										<td data-field="handle" align="center" data-off="true">
											<div class="layui-table-cell laytable-cell-1-3">
												&nbsp;&nbsp;
												<!--如果有多个参数则 则用逗号隔开,-->
												<a class="layui-btn layui-btn-primary layui-btn-xs"
												   th:href="@{/admin/info/descUI/(infoId=${info.infoId})}" >查看</a>
												&nbsp;&nbsp;
												<a class="layui-btn layui-btn-xs"
													th:href="@{/admin/info/editUI/(infoId=${info.infoId})}"
												>编辑</a>
												&nbsp;&nbsp;
												<a class="layui-btn layui-btn-danger layui-btn-xs"
												   th:href="@{/admin/info/editUI/(infoId=${info.infoId})}"
												   onclick="return confirm('你真的要删除吗？')"
												>删除</a>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div id="fenye" style="width: 750px;"></div>
					</div>
					<script>
						var mytest = "你好";
					</script>
			</div>
		</div>
	</body>

</html>